using Holoville.HOTween;
using Holoville.HOTween.Core;
using UnityEngine;

public class LbFarmReputationMoney : MonoBehaviour
{
	[SerializeField]
	private GameObject cashIcon;

	[SerializeField]
	private GameObject goldIcon;

	[SerializeField]
	private GameObject backGround;

	[SerializeField]
	private UILabel lbMoney;

	[SerializeField]
	private Color cashColor;

	[SerializeField]
	private Color goldColor;

	private int LBMoney
	{
		set
		{
			if (lbMoney.text != value.ToString())
			{
				lbMoney.text = value.ToString();
				HOTween.To(base.transform, 0.5f, new TweenParms().Prop("localScale", Vector3.one * 1.5f).OnComplete((TweenDelegate.TweenCallback)delegate
				{
					HOTween.To(base.transform, 0.5f, new TweenParms().Prop("localScale", Vector3.one));
				}));
			}
		}
	}

	private void Awake()
	{
		HOTween.Init();
	}

	private void OnDisable()
	{
	}

	public void ShowMoneyFarm(int cashCount, bool isElite = false)
	{
		if (isElite)
		{
			cashIcon.SetActive(false);
			goldIcon.SetActive(true);
			lbMoney.color = goldColor;
		}
		else
		{
			cashIcon.SetActive(true);
			goldIcon.SetActive(false);
			lbMoney.color = cashColor;
		}
		backGround.SetActive(true);
		lbMoney.gameObject.SetActive(true);
		LBMoney = cashCount;
	}

	public void HidePunel()
	{
		lbMoney.gameObject.SetActive(false);
		goldIcon.SetActive(false);
		cashIcon.SetActive(false);
		backGround.SetActive(false);
	}
}
